package com.practice;

import java.util.Random;

public class demo21 {
    public static void main(String[] args) {
        //定义一个长度为10的int类型数组
        int[] arr = new int[10];
        //随机数
        Random r = new Random();
        for (int i = 0; i < arr.length; i++) {
            //遍历数组，接收10个随机数
            arr[i] = r.nextInt(50, 81);
            System.out.print(arr[i] + " ");
        }
        System.out.println();
        //定义计数器，若结束循环后计数器为0，即所有随机数都不满足条件，给出反馈
        int count = 0;
        for (int a = 0; a < arr.length; a++) {
            //提取数组中所有数字的个位数和十位数
            int ge = arr[a] % 10;
            int shi = arr[a] / 10 % 10;
            //判断是否满足个位和十位不包含七
            if (ge != 7 && shi != 7) {
                System.out.print(arr[a] + " ");
                count++;
            }
        }
        System.out.println();
        System.out.println(count);
        if (count == 0) {
            //给出均不满足条件的反馈
            System.out.println("随机数组所有元素个位和十位均含有7");
        }
    }
}